#include "gameresultdialog.h"
#include "ui_gameresultdialog.h"

GameResultDialog::GameResultDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::GameResultDialog),
    opponentScoreBoardPtr_(std::make_shared<score_board>(this)),
    selfScoreBoardPtr_(std::make_shared<score_board>(this))
{
    ui->setupUi(this);

    opponentScoreBoardPtr_->move(0, 200);
    selfScoreBoardPtr_->move(230, 200);

    connect(ui->confirmButton, &QPushButton::clicked, this, [this]() {
        this->close();
    });
}

GameResultDialog::~GameResultDialog()
{
    delete ui;
}

void GameResultDialog::setGameResult(const QString &result)
{
    ui->gameResultLabel->setText(result);
};

void GameResultDialog::setGameTime(const QString &time)
{
    ui->timeUsedLabel->setText(time);
};
